package cn.btks.backstagemanage.division.repository;

import cn.btks.backstagemanage.division.pojo.City;
import cn.btks.backstagemanage.division.pojo.County;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Author lijun
 * @Date 2021/1/25 11:02
 */
@Repository
public interface CountyRepository extends JpaRepository<County,Long> {

    /**
     * 根据团场名称查询
     * @param name
     * @return
     */
    County findByName(String name);

    /**
     * 查询师下的团场信息
     * @param cityId
     * @return
     */
    List<County> findAllByCityId(Long cityId);

    /**
     * 根据代管师的ID查询其代管团场
     * @param cityId
     * @return
     */
    List<County> findAllByEscrowId(Long cityId);
}
